<html>
<head>
  <title>WebChat | 登陆</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <link href="/source/css/login.css" rel='stylesheet' type='text/css' />
  <script src="/plugins/jquery/jquery-2.1.4.min.js"></script>
  <script src="/plugins/layer/layer.js"></script>
</head>
<body>

<h1>WebChat</h1>
<div class="login-form">
  <div class="close"> </div>
  <div class="head-info">
    <label class="lbl-1"></label>
    <label class="lbl-2"></label>
    <label class="lbl-3"></label>
  </div>
  <div class="clear"> </div>
  <div class="avtar"><img src="/source/img/avtar.png" alt="点我注册"/></div>
  <form >
    <div class="key"   >
      <input type="text" id="username" name="userid" placeholder="请输入用户名" >
    </div>
    <div class="key" >
      <input type="password" id="password" name="password" placeholder="请输入密码">
    </div>    
  
     <div class="signin">
      <input type="submit" id="submit" value="Register" />
    </div>    
  
  </form>
</div>

<script>
  

  /**
   * check the login form before user login.
   * @returns {boolean}
   */
  function checkLoginForm(){
    var username = $('#username').val();
    var password = $('#password').val();
    if(isNull(username) && isNull(password)){
      $('#submit').attr('value','请输入账号和密码!!!').css('background','red');
      return false;
    }
    if(isNull(username)){
      $('#submit').attr('value','请输入账号!!!').css('background','red');
      return false;
    }
    if(isNull(password)){
      $('#submit').attr('value','请输入密码!!!').css('background','red');
      return false;
    }
    //if(username != 'Amaya' || password != '123456'){
    //	$('#submit').attr('value','账号或密码错误!!!').css('background','red');
    //	return false;
    //}
    else{
      $('#submit').attr('value','Logining~');
      return true;
    }
  }

  /**
   * check the param if it's null or '' or undefined
   * @param input
   * @returns {boolean}
   */
  function isNull(input){
    if(input == null || input == '' || input == undefined){
      return true;
    }
    else{
      return false;
    }
  }
</script>
</body>
</html>